Optimal. Leaf size=55 \[ -\frac {a^2}{c x}+\frac {b^2 x}{d}-\frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{c^{3/2} d^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {472, 211}
\begin {gather*} -\frac {a^2}{c x}-\frac {(b c-a d)^2 \text {ArcTan}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{c^{3/2} d^{3/2}}+\frac {b^2 x}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 472
Rubi steps
\begin {align*} \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )} \, dx &=\int \left (\frac {b^2}{d}+\frac {a^2}{c x^2}-\frac {(b c-a d)^2}{c d \left (c+d x^2\right )}\right ) \, dx\\ &=-\frac {a^2}{c x}+\frac {b^2 x}{d}-\frac {(b c-a d)^2 \int \frac {1}{c+d x^2} \, dx}{c d}\\ &=-\frac {a^2}{c x}+\frac {b^2 x}{d}-\frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{c^{3/2} d^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 55, normalized size = 1.00 \begin {gather*} -\frac {a^2}{c x}+\frac {b^2 x}{d}-\frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{c^{3/2} d^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 65, normalized size = 1.18
method | result | size |
default | \(\frac {b^{2} x}{d}+\frac {\left (-a^{2} d^{2}+2 a b c d -b^{2} c^{2}\right ) \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{c d \sqrt {c d}}-\frac {a^{2}}{c x}\) | \(65\) |
risch | \(\frac {b^{2} x}{d}-\frac {a^{2}}{c x}-\frac {d \ln \left (-\sqrt {-c d}\, x -c \right ) a^{2}}{2 \sqrt {-c d}\, c}+\frac {\ln \left (-\sqrt {-c d}\, x -c \right ) a b}{\sqrt {-c d}}-\frac {c \ln \left (-\sqrt {-c d}\, x -c \right ) b^{2}}{2 d \sqrt {-c d}}+\frac {d \ln \left (-\sqrt {-c d}\, x +c \right ) a^{2}}{2 \sqrt {-c d}\, c}-\frac {\ln \left (-\sqrt {-c d}\, x +c \right ) a b}{\sqrt {-c d}}+\frac {c \ln \left (-\sqrt {-c d}\, x +c \right ) b^{2}}{2 d \sqrt {-c d}}\) | \(178\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 63, normalized size = 1.15 \begin {gather*} \frac {b^{2} x}{d} - \frac {a^{2}}{c x} - \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d} c d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.42, size = 164, normalized size = 2.98 \begin {gather*} \left [\frac {2 \, b^{2} c^{2} d x^{2} - 2 \, a^{2} c d^{2} - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {-c d} x \log \left (\frac {d x^{2} + 2 \, \sqrt {-c d} x - c}{d x^{2} + c}\right )}{2 \, c^{2} d^{2} x}, \frac {b^{2} c^{2} d x^{2} - a^{2} c d^{2} - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {c d} x \arctan \left (\frac {\sqrt {c d} x}{c}\right )}{c^{2} d^{2} x}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 165 vs.
\(2 (44) = 88\).
time = 0.40, size = 165, normalized size = 3.00 \begin {gather*} - \frac {a^{2}}{c x} + \frac {b^{2} x}{d} + \frac {\sqrt {- \frac {1}{c^{3} d^{3}}} \left (a d - b c\right )^{2} \log {\left (- \frac {c^{2} d \sqrt {- \frac {1}{c^{3} d^{3}}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} - \frac {\sqrt {- \frac {1}{c^{3} d^{3}}} \left (a d - b c\right )^{2} \log {\left (\frac {c^{2} d \sqrt {- \frac {1}{c^{3} d^{3}}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.58, size = 63, normalized size = 1.15 \begin {gather*} \frac {b^{2} x}{d} - \frac {a^{2}}{c x} - \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d} c d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.07, size = 80, normalized size = 1.45 \begin {gather*} \frac {b^2\,x}{d}-\frac {a^2}{c\,x}-\frac {\mathrm {atan}\left (\frac {\sqrt {d}\,x\,{\left (a\,d-b\,c\right )}^2}{\sqrt {c}\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}\right )\,{\left (a\,d-b\,c\right )}^2}{c^{3/2}\,d^{3/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________